2024-08-25T14:01:59,434713191+00:00
My set top box comes with Realtek 8723as wifi over sdio, which is not supported by both mainline kernel driver and out-of-tree kernel driver. I bought a small TP-Link based usb dongle in a local store and the result is that the firmware often fails to load. I’ve documented my workaround to deal with the problematic usb wifi dongle.
So I browsed local online marketplace for another wifi dongle. The dongle comes after one day and tried it on my set top box.
After plugging it on the usb port, I waited for a while for the device to be connected. After several minutes of waiting and performing scan on port 22, there is no sign that the device is connected. So as my last troubleshooting attempt, I grabbed a usb cable, connected my Android phone to the cable as usb tethering. From the ethernet over usb, I can connect to the box to perform some troubleshooting.
The product page of the recently bought usb dongle says that it is
based on mt7601 chipset. When looking at lsusb
output, it’s
no mt7601 but another 0bda
device with different product id
(0179
instead of 8179
on the previous
dongle).
Bus 002 Device 026: ID 0bda:0179 Realtek Semiconductor Corp. RTL8188ETV Wireless LAN 802.11n Network Adapter
Looking at the kernel log, there was failed attempt to load firmware
for rtl8xxxu
driver. So I modified the
/etc/udev/rules.d/99-realtek-dongle.rules
to include the
newly found vendor id and product id.
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8179", RUN+="/usr/bin/systemctl start toggle-usb-wifi-port.service"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="0179", RUN+="/usr/bin/systemctl start toggle-usb-wifi-port.service"
The /etc/systemd/system/toggle-usb-wifi-port.service
is
still the same as before.
[Unit]
Description=Reset USB port to load realtek wifi dongle
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh /usr/local/sbin/toggle-usb-port.sh
Of course, the /usr/local/sbin/toggle-usb-port.sh
is
modified to also perform toggling on the newly bought usb dongle. Here
is the shell script adopted to also perform toggling on
08da:0179
device.
#!/bin/sh
for WIFI_DEVICE in "0bda:8179" "0bda:0179" ; do
if ! uhubctl -s "$WIFI_DEVICE" ; then
echo "No Realtek Wi-Fi dongle with id $WIFI_DEVICE is connected."
else
sleep 2
until ip link | grep wl ; do
uhubctl -s "$WIFI_DEVICE" -a 2 ; sleep 3
done
fi
done
After several attempts of toggling usb port via uhubctl
,
the wireless interface comes up.
[ 190.596926] usb 2-1: new high-speed USB device number 26 using ehci-platform [ 190.753898] usb 2-1: New USB device found, idVendor=0bda, idProduct=0179, bcdDevice= 0.00 [ 190.753957] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 190.753981] usb 2-1: Product: 802.11n NIC [ 190.753999] usb 2-1: Manufacturer: Realtek [ 190.754017] usb 2-1: SerialNumber: E0B2F158737C [ 192.584424] usb 2-1: This Realtek USB WiFi dongle (0x0bda:0x0179) is untested! [ 192.584484] usb 2-1: Please report results to Jes.Sorensen@gmail.com [ 192.732625] usb 2-1: Dumping efuse for RTL8188EU (0x200 bytes): [ 192.732672] 00000000: 29 81 00 6c 0b 00 00 00 00 0c 00 00 00 00 00 00 )..l............ [ 192.732684] 00000010: 2c 2c 2b 2b 2b 2b 30 2f 2e 2e 2d 00 ff ff ff ff ,,++++0/..-..... [ 192.732695] 00000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732705] 00000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732714] 00000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732724] 00000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732734] 00000060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732744] 00000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732753] 00000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732763] 00000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732772] 000000a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732782] 000000b0: ff ff ff ff ff ff ff ff 20 2a 1a 00 00 00 00 00 ........ *...... [ 192.732792] 000000c0: 00 00 00 10 00 00 00 00 00 03 ff ff ff ff ff ff ................ [ 192.732802] 000000d0: da 0b 79 01 42 66 00 e0 b2 f1 58 73 7c 0a 03 52 ..y.Bf....Xs|..R [ 192.732812] 000000e0: 65 61 6c 74 65 6b 0d 0d 03 38 30 32 2e 31 31 6e ealtek...802.11n [ 192.732821] 000000f0: 20 4e 49 43 ff ff ff ff ff ff ff ff ff ff ff ff NIC............ [ 192.732831] 00000100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732841] 00000110: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732851] 00000120: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732908] 00000130: 81 ae 96 2d 03 93 96 11 fc 8c 00 11 9b ff ff ff ...-............ [ 192.732924] 00000140: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732935] 00000150: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732945] 00000160: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732955] 00000170: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732966] 00000180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732977] 00000190: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732987] 000001a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.732998] 000001b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.733009] 000001c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.733020] 000001d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.733031] 000001e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.733042] 000001f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ [ 192.733056] usb 2-1: RTL8188EU rev A (TSMC) romver 0, 1T1R, TX queues 2, WiFi=1, BT=0, GPS=0, HI PA=0 [ 192.733078] usb 2-1: RTL8188EU MAC: e0:b2:f1:58:73:7c [ 192.733096] usb 2-1: rtl8xxxu: Loading firmware rtlwifi/rtl8188eufw.bin [ 192.746861] usb 2-1: Firmware revision 11.1 (signature 0x88e1) [ 193.331745] usb 2-1: Enabling HT_20_40 on the 2.4GHz band [ 193.339638] usbcore: registered new interface driver rtl8xxxu
It took 193 seconds for the wifi interface to come up with usb toggling performed. What a long waiting time to have.
My attempt to get a perfect dongle was ruined by this. Fortunately, the dongle is still working fine after those workarounds, which is acceptable.
Things didn’t go smoothly as I envisioned, but I am still glad that the dongle works fine.
For those bumping into similar issue, I hope that this workaround will make the day better.
Thanks for visiting my webspace.